<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品一览页面</title>
<link href="css/jimu.css" type="text/css" rel="stylesheet">
<script type="text/javascript">
function confirmDel(str){   
 return confirm(str);   
	}   
</script>
</head>
<body>
<!-- 头部的包含文件 -->
<%@include file="../common/head.jsp" %>
<table class="main">
	<tr>
		<td style="width:180px; vertical-align:top;">
		<%@ include file="../common/menu.jsp" %>
		</td>
		<td style="vertical-align:top;padding:20px;">
			<p>商品一览：</p>
			<table class="listTbl">
				<tr>
					<th>商品编号</th>
					<th>商品图片</th>
					<th>商品大分类</th>
					<th>商品小分类</th>
					<th>商品名称</th>
					<th>商品价格</th>
					<th>现价</th>
					<th>在库数</th>
					<th>操作</th>
				</tr>
				
				<s:iterator value="prodList">
				<tr>
					<td style="text-align:center;"><s:property value="productid"/></td>
					<td>
						<img style="height:50px" alt="<s:property value="productname"/>" src="photo/product/<s:property value="photo"/>">
					</td>
					<td>
						<!-- 大分类名 -->
						<s:property value="subtype.supertype.supertypeid"/>.<s:property value="subtype.supertype.typename"/>
					</td>
					<td>
						<!-- 小分类名 -->
						<s:property value="subtype.subtypeid"/>.<s:property value="subtype.subtypename"/>
					</td>
					<td>
						<a href="prodDetail.action?productid=<s:property value="productid"/>">
						<s:property value="productname"/>
						</a>
					</td>
					<td style="text-align:right;"><s:property value="price"/></td>
					<td style="text-align:right;"><s:property value="nowprice"/></td>
					<td style="text-align:right;"><s:property value="productNum"/></td>
					<td style="text-align:center;">
						<a href="tomodiProd.action?productid=<s:property value="productid"/>">修改</a>
						<a href="delProd.action?productid=<s:property value="productid" /> " onclick="return confirmDel('确定要删除吗')">删除</a>
					</td>
				</tr>
				</s:iterator>
				
			</table>
			<div style="padding:10px;">
			<a href="toaddProd.action">追加新商品</a>
			</div>
			
		</td>
	</tr>
</table>

<%@include file="../common/tail.jsp" %>
</body></html>